<?php
namespace App\Repository\Common;
class ConstTable
{
    //定义常量

    //数据状态文字
    const STATUS_NAME = [
        1 => '启用',
        2 => '禁用',
        -1 => '删除',
    ];

    //新闻数据状态文字
    const NEWS_STATUS_NAME = [
        1 => '发布',
        2 => '保存',
    ];
    //职位数据状态文字
    const JOIN_STATUS_NAME = [
        1 => '发布',
        2 => '保存',
    ];
    //职位类型状态文字
    const JOIN_TYPE_NAME = [
        1 => '全职',
        2 => '兼职',
    ];


    /**
     * 每次总共几场的时间
     *
     * date_default_timezone_set("PRC");
     * $start = strtotime('1970-01-01 09:00:00');
     * $i=0;
     * while ($i< 10) {
     * echo "\r\n";
     * $a=$start + 7200;
     * echo "['start_time' => $start, 'end_time' => $a],";
     * $start+=7200;
     * $i++;
     * }
     *
     */
    const  DAY_TOTAL_BLOCK_LIST = [
        1 => [
            ['start_time' => -3600, 'end_time' => 3600],
            ['start_time' => 3600, 'end_time' => 10800],
            ['start_time' => 10800, 'end_time' => 18000],
            ['start_time' => 18000, 'end_time' => 25200],
            ['start_time' => 25200, 'end_time' => 32400],
            ['start_time' => 32400, 'end_time' => 39600],
            ['start_time' => 39600, 'end_time' => 46800],
            ['start_time' => 46800, 'end_time' => 54000],
            ['start_time' => 54000, 'end_time' => 61200],
        ],
        2 => [
            ['start_time' => 0, 'end_time' => 7200],
            ['start_time' => 7200, 'end_time' => 14400],
            ['start_time' => 14400, 'end_time' => 21600],
            ['start_time' => 21600, 'end_time' => 28800],
            ['start_time' => 28800, 'end_time' => 36000],
            ['start_time' => 36000, 'end_time' => 43200],
            ['start_time' => 43200, 'end_time' => 50400],
            ['start_time' => 50400, 'end_time' => 57600],
            ['start_time' => 57600, 'end_time' => 64800],
        ],
    ];

    const  ORDER_TYPE = [
        1 => '约战',
        2 => '应战',
        3 => '订场'
    ];

    const  PAY_TYPE_TEXT = [
        1 => '未支付',
        2 => '已支付',
        3 => '已退款'
    ];
//    const  ORDER_STATUS = [
//        1 => '匹配中',
//        2 => '已匹配',
//        3 => '已取消'
//    ];

    const  ORDER_STATUS = [
        1 => '已订场',
        2 => '已匹配',
        3 => '已完成',
        4 => '待评价',
        5 => '已取消',
        6 => '未匹配',
    ];


    /*
     *   $s = 1;
        if ($order_type == 3 and $pay_type == 2 and $status == 2 and $day_time > time()) {  //已订场
            $s = 1;
        } elseif ($pay_type == 3) {  //已取消
            $s = 5;
        } elseif ($pay_type == 2 and $status == 2 and $day_time < time()) { //已完成
            $s = 3;
        } elseif (in_array($order_type, [1, 2]) and $pay_type == 2 and $status == 2) { //已匹配
            $s = 2;
        } elseif ($pay_type == 2 and $status == 2 and $is_comment == 2) { //待评价
            $s = 4;
        } elseif (in_array($order_type, [1, 2]) and $pay_type == 2 and $status == 1) {  //未匹配
            $s = 6;
        }

        if ($type == 4) {
            $s = 4;
        }
    */
}